<!--
 * @Author: caoxiang caoxiang@huaqinits.com
 * @Date: 2022-07-19 09:46:33
 * @LastEditors: caoxiang caoxiang@huaqinits.com
 * @LastEditTime: 2023-02-17 14:44:07
 * @FilePath: \admin-web\src\components\permissions\permissions.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
  <div style="display:inline;">
    <slot v-if="roleCode === 'R0001' ? true : show"></slot>
  </div>
</template>

<script>

export default {
  props: {
    type: {
      type: String,
      required: true,
      roleCode: null
    }
  },
  created () {
    this.roleCode = this.$store.state.account.user.roleCode
  },
  computed: {
    show () {
      return this.$route &&
        this.$route.meta &&
        this.$route.meta.permissions instanceof Array &&
        this.$route.meta.permissions.includes(this.type)
    }
  }

}
</script>
